<template>
    <div class="booklist-contianer">
        <div v-for="(book,index) in bookList" :key="book.id +' '+index" @click="pushdetalist(book.id)" >
            <Book :b="book" />
        </div>
        
    </div>
</template>
<script>
import Book from './book.vue'
export default {
    props:{
        bookList:{
            type:Array,
            default:[]
        }
    },
    components:{
       Book,
    },
    data() {
        return{
        }
    },
    methods:{
        pushdetalist(id){
            console.log(id);
           this.$router.push(`/detalist?${id}`);
        }
    }
}
</script>
<style lang="less" scoped>
@media screen and (max-width:600px) {
        .booklist-contianer{
            width: 100% !important;
             transform: translateX(-10%);
        }
}


.booklist-contianer{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 80%;
}
    div{
        cursor: pointer;
        display: inline-block;
        margin-left: 20px;
        margin-top: 10px;
        width: 200px;
        box-sizing: border-box;
    }
    div:hover {
       color: #000;
       
    }
</style>